Keir Fraser [Thu, 1 Dec 2011 00:59:58 +0000 (16:59 -0800)]
xenpaging: Fix c/s 23507:
0a29c8c3ddf7 ("update machine_to_phys_mapping[] during page deallocation")
This patch clobbers page owner in free_heap_pages() before we are
finished using it. This means that a subsequent test to determine
whether it is safe to avoid safety TLB flushes incorrectly always
determines that it is safe to do so.
The fix is simple: we can defer the original patch's work until after
we are done with the page-owner field.
Thanks to Christian Limpach for spotting this one.
Signed-off-by: Keir Fraser <keir@xen.org>
Paul Durrant [Wed, 30 Nov 2011 15:18:11 +0000 (07:18 -0800)]
hvmloader: Write address of VM generation id buffer into xenstore
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Keir Fraser [Wed, 30 Nov 2011 15:12:41 +0000 (07:12 -0800)]
Free d->mem_event on domain destruction.
Signed-off-by: Keir Fraser <keir@xen.org>
Olaf Hering [Wed, 30 Nov 2011 15:08:53 +0000 (07:08 -0800)]
mem_event: move mem_event_domain out of struct domain
An upcoming change may increase the size of mem_event_domain. The result
is a build failure because struct domain gets larger than a page.
Allocate the room for the three mem_event_domain members at runtime.
v2:
- remove mem_ prefix from members of new struct
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Keir Fraser <keir@xen.org>
George Dunlap [Wed, 30 Nov 2011 15:06:24 +0000 (07:06 -0800)]
x86/hvm/vmx: Trace traps and realmode exits
Add some more tracing to vmexits that don't currently have
trace information:
* VMX realmode emulation
* Various VMX traps
* Fast-pathed APIC accesses
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Paul Durrant [Wed, 30 Nov 2011 14:57:20 +0000 (06:57 -0800)]
hvmloader: Add xenstore-write support
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Paul Durrant [Wed, 30 Nov 2011 14:55:31 +0000 (06:55 -0800)]
hvmloader: Add snprintf()
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Paul Durrant [Wed, 30 Nov 2011 14:53:36 +0000 (06:53 -0800)]
hvmloader: Allocate an 8 byte buffer to contain the VM generation id
and populate it at boot time with a value read from
"platform/generation_id". Also add code to libxl to populate this
xenstore key with the value of a new 'generation_id' parameter in the
VM config file. Populate the ADDR package of VM_Gen_Counter ACPI
device such that the first integer evaluates to the low order 32 bits
of the buffer address and the second integer evaluates to the high
order 32 bits of the buffer address.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Paul Durrant [Wed, 30 Nov 2011 14:50:45 +0000 (06:50 -0800)]
hvmloader: Add 'ctype' infrastructure
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Paul Durrant [Wed, 30 Nov 2011 14:47:16 +0000 (06:47 -0800)]
hvmloader: Add an ACPI device exposing a package called ADDR,
evaluating to two integers, and with _CID and _DDN set to
"VM_Gen_Counter".
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Paul Durrant [Wed, 30 Nov 2011 14:42:04 +0000 (06:42 -0800)]
x86/hvm: Re-instate HVM IRQ debug code and add keyhandler.
I found this patch useful a couple of times while trying to debug the
viridian problem. irq_dump() was #ifdef-ed out so this patch puts it
back and registers a handler on the 'I' key to iterate over all HVM
domains and call it.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Jan Beulich [Wed, 30 Nov 2011 09:23:41 +0000 (10:23 +0100)]
x86/cpuidle: add Westmere-EX support to hw residencies reading logic
This is in accordance with
http://software.intel.com/en-us/articles/intel-processor-identification-with-cpuid-model-and-family-numbers/
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Haitao Shan <maillists.shan@gmail.com>
Konrad Rzeszutek Wilk [Tue, 29 Nov 2011 18:30:39 +0000 (13:30 -0500)]
doc: Update MMU_NORMAL_PT_UPDATE about the val.
The val is used as the pagetable entry with the machine
frame number and some page table bits. This explains
what those page table bits are.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Konrad Rzeszutek Wilk [Tue, 29 Nov 2011 17:02:01 +0000 (12:02 -0500)]
doc: Update MMU_NORMAL_PT_UPDATE requirements.
There are some implicit requirements when using the hypercall
which are not mentioned.
Mainly the requirement that the pagetable be RO.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 16:23:27 +0000 (16:23 +0000)]
docs: improve index.html generation
Include hypercall documentation, fixing link generation for top level links to
use the INDEX.
Allow subsection links to be renamedi in the INDEX too.
Strip .txt suffixes as well as .html ones by moving the regex to the right
place instead of placing the literal text "(?:html|txt)" into the backlink to
the top level page. (oops)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Tue, 29 Nov 2011 15:48:08 +0000 (15:48 +0000)]
docs/html/: Arrange for automatic build of hypercall docs
- Use index.html rather than a stamp file.
- Automatically generate dependencies.
- Wire into the docs build system
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 29 Nov 2011 15:48:07 +0000 (15:48 +0000)]
docs/html/: Generate an "index.html" for hypercall docs
Generate an "index.html" containing various useful links.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 29 Nov 2011 15:48:07 +0000 (15:48 +0000)]
docs/html/: Annotations for two hypercalls
Add annotations for a couple of the hypercalls:
HYPERVISOR_set_trap_table
HYPERVISOR_mmu_update
We do this by
* annotating the list of #defines for hypercall numbers
* annotating the list of error values
* providing a function prototype for the systematically-named functions
The header generator does the rest.
This exercise revealed a couple of infelicities:
* In the actual source code, do_mmu_update is defined to return an int
and do_set_trap_table a long. However both functions return either
-Efoo (on error) or 0 for success.
* The error numbers are defined only in the private header file
xen/include/xen/errno.h and then only with names which will
typically clash with other projects. It would be nice to include a
public version of this header which defines XEN_E*. But for now
we run xen-headers on errno.h too.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Tue, 29 Nov 2011 15:48:06 +0000 (15:48 +0000)]
docs/html/: Initial cut of header documentation massager
"xen-headers" generates HTML from header files. So far this generates
just some type cross-references, if you say
make -C docs html/hypercall/stamp
An index page, proper wiring into the build system, and a few more
annotations in the headers, and will be forthcoming.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 14:19:59 +0000 (14:19 +0000)]
docs: improve documantion of xl's viridian option
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 14:17:27 +0000 (14:17 +0000)]
docs: xlexample.hvm: mention the viridian setting.
Turning this on for Windows guests is recommended.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 14:17:27 +0000 (14:17 +0000)]
docs: install txt files as html
A browser will display them just fine.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 15:21:23 +0000 (15:21 +0000)]
xl: make bootloader_args a list
This is much more natural. Continue to support the old syntax in xl
but deprecate it.
[ Fixed up a long line in xl_cmdimpl.c. -iwj ]
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 14:17:27 +0000 (14:17 +0000)]
libxlu: add xlu_cfg_get_list_as_string_list
Returns a cfg list as a libxl_string_list.
Use this to simplify the parsing of device model extra args.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 14:17:27 +0000 (14:17 +0000)]
docs: move user and interface .tex documents under reference.
Taking over the top level "user" entry with a relatively obsolete document is a
bit of an annoyance but these docs are not so out of date that they should be
deleted. Move them out of the top-level instead.
(the original motivation here was to allow for user/xl-domain-cfg.markdown but
we have since decided to go with man/xl.cfg.pod.5 instead so perhaps this is a
waste of time)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 14:17:27 +0000 (14:17 +0000)]
docs: generate an index for the html output
nb: I'm not a Perl wizard...
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 14:17:27 +0000 (14:17 +0000)]
docs: tweak markup and wording of qemu upstream doc slightly
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 15:18:18 +0000 (15:18 +0000)]
docs: remove non-breaking spaces from sedf_scheduler_mini-HOWTO.txt
This document contains several 0xa0 characters (non-breaking spaces). These do
not display correctly in (some) terminals or when the document is rendered by (some)
browsers. Re-encode them as spaces.
I'm not confident that this change will make it through being encoded as a patch
and sent through email. Its effect can be replicated with:
perl -i -p -e 's/\xa0/ /g' docs/misc/sedf_scheduler_mini-HOWTO.txt
[ I ran the rune rather than trying to apply the patch -iwj ]
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 14:17:27 +0000 (14:17 +0000)]
libxl: use named options for tsc_mode.
Add an enum at the libxl level with a hopefully descriptive set of names.
Deprecate the use of an integer in xl cfg files.
Signed-off-by: Ian Campbell
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 14:17:27 +0000 (14:17 +0000)]
xlu: add "dont_warn" to xlu_cfg_*
I want it for get_long but we might as well have it everywhere.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 14:17:27 +0000 (14:17 +0000)]
xl: the name field in a guest config file is mandatory
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 14:17:27 +0000 (14:17 +0000)]
docs: add a document describing the xl cfg file syntax
Based on an initial version by Ian Jackson.
I believe that all keys are now present in the document although there are are
various omissions in the actual documentation of them. Hopefully however this
covers the majority of the most interesting keys.
Spice section:
Signed-off-by: Zhou Peng <zhoupeng@nfs.iscas.ac.cn>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
The rest:
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 14:17:27 +0000 (14:17 +0000)]
docs: install html and txt versions of manpages
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 14:17:27 +0000 (14:17 +0000)]
README: add markdown to dependency list
although this tool is strictly speaking optional we are providing various user
docs in this format so increase the changes that they will install it.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 14:17:27 +0000 (14:17 +0000)]
docs: xlexample.hvm is missing "builder = 'hvm'"
This is rather critical...
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Tue, 29 Nov 2011 13:53:31 +0000 (13:53 +0000)]
Replace references to old wiki with ones to new.
I have confirmed that the relevant pages have been transitioned.
What remains is pages which have not yet been moved over:
$ rgrep xenwiki *
tools/libxen/README:http://wiki.xensource.com/xenwiki/XenApi
tools/xenballoon/xenballoond.README:http://wiki.xensource.com/xenwiki/Open_Topics_For_Discussion?action=AttachFile&do=get&target=Memory+Overcommit.pdf
Note that "PythonInXlConfig" never existed in the old wiki and does not exist
in the new. This reference was introduced by 22735:
cb94dbe20f97 and was
supposed to have been written prior to the 4.1 release. I have transitioned it
anyway but it's not clear how valuable the message actually is. Perhaps we
should just remove that aspect of it?
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Mon, 28 Nov 2011 17:42:40 +0000 (17:42 +0000)]
libxl: propagate error from tap_ctl_spawn.
Failure here means that a disk will not be correctly setup. I briefly
scanned tools/blktap2/control.c for other goto constructs which did not
set their err variable but didn't see any others.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Mon, 28 Nov 2011 17:42:06 +0000 (17:42 +0000)]
Update QEMU_TAG
Ian Jackson [Mon, 28 Nov 2011 17:19:28 +0000 (17:19 +0000)]
libxl: open logs with O_APPEND
Logfiles should always be opened for append.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Mon, 28 Nov 2011 11:57:23 +0000 (11:57 +0000)]
tools: Revert to our built-in aio
These two changesets:
24184:
4ecd3615e726 tools: use system installed libaio by default.
24186:
7aa5838499d1 tools: use system libaio for blktap1 as well.
cause HVM guest installs (both Windows and Redhat) to fail on Debian
squeeze with xl. So change the default for now.
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Fri, 25 Nov 2011 20:32:05 +0000 (20:32 +0000)]
waitqueue: Hold a reference to a domain on a waitqueue.
Also allow waitqueues to be dynamically destroyed.
Signed-off-by: Keir Fraser <keir@xen.org>
Keir Fraser [Fri, 25 Nov 2011 20:27:11 +0000 (20:27 +0000)]
waitqueue: Implement wake_up_{nr,one,all}.
Signed-off-by: Keir Fraser <keir@xen.org>
Paul Durrant [Fri, 25 Nov 2011 15:48:03 +0000 (15:48 +0000)]
hvm/viridian: Ditch the extra assertions/warnings for non-viridian guests.
Consensus is they are over-aggressive.
Signed-off-by: Keir Fraser <keir@xen.org>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Fri, 25 Nov 2011 15:30:41 +0000 (15:30 +0000)]
Fix save/restore for HVM domains with viridian=1
xc_domain_save/restore currently pay no attention to
HVM_PARAM_VIRIDIAN which results in an HVM domain running a recent
version on Windows (post-Vista) locking up on a domain restore due to
EOIs (done via a viridian MSR write) being silently dropped. This
patch adds an extra save entry for the viridian parameter and also
adds code in the viridian kernel module to catch attempted use of
viridian functionality when the HVM parameter has not been set.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Keir Fraser [Fri, 25 Nov 2011 13:31:58 +0000 (13:31 +0000)]
atomic: Define {read,write}_atomic() for reading/writing memory atomically.
Signed-off-by: Keir Fraser <keir@xen.org>
Olaf Hering [Sun, 20 Nov 2011 17:26:16 +0000 (18:26 +0100)]
xenpaging: restrict pagefile permissions
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 17:26:15 +0000 (18:26 +0100)]
xenpaging: add debug to show received watch event.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:02:50 +0000 (17:02 +0100)]
xenpaging: improve policy mru list handling
Without this change it is not possible to page-out all guest pages, then
trigger a page-in for all pages, and then page-out everything once
again. All pages in the mru list can not be paged out because they
remain active in the internal bitmap of paged pages.
Use the mru list only if the number of paged-out pages is larger than
the mru list. If the number is smaller, start to clear the mru list. In
case the number of paged-out pages drops to zero the mru list and the
internal bitmap will be empty as well.
Also add a new interface for dropped pages. If a gfn was dropped there
is no need to adjust the mru list because dropping a page is not usage
of a page.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:02:48 +0000 (17:02 +0100)]
xenpaging: add cmdline interface for pager
Introduce a cmdline handling for the pager. This simplifies libxl support,
debug and mru_size are not passed via the environment anymore.
The new interface looks like this:
xenpaging [options] -f <pagefile> -d <domain_id>
options:
-d <domid> --domain=<domid> numerical domain_id of guest. This option is required.
-f <file> --pagefile=<file> pagefile to use. This option is required.
-m <max_memkb> --max_memkb=<max_memkb> maximum amount of memory to handle.
-r <num> --mru_size=<num> number of paged-in pages to keep in memory.
-d --debug enable debug output.
-h --help this output.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:02:47 +0000 (17:02 +0100)]
xenpaging: watch the guests memory/target-tot_pages xenstore value
Subsequent patches will use xenstored to store the numbers of pages
xenpaging is suppose to page-out.
Remove num_pages and use target_pages instead.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:02:45 +0000 (17:02 +0100)]
xenpaging: use guests tot_pages as working target
This change reverses the task of xenpaging. Before this change a fixed number
of pages was paged out. With this change the guest will not have access to
more than the given number of pages at the same time.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:02:43 +0000 (17:02 +0100)]
xenpaging: add XEN_PAGING_DIR / libxl_xenpaging_dir_path()
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:02:42 +0000 (17:02 +0100)]
xenpaging: install into LIBEXEC dir
In preparation of upcoming libxl integration,
move xenpaging binary from /usr/sbin/ to /usr/lib/xen/bin/
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:02:41 +0000 (17:02 +0100)]
xenpaging: retry unpageable gfns
Nomination of gfns can fail, but may succeed later.
Thats the case for a guest that starts ballooned.
v2:
- print debug when clearing uncosumed happens
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:02:40 +0000 (17:02 +0100)]
libxc: add bitmap_clear function
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:02:39 +0000 (17:02 +0100)]
xenpaging: improve mainloop exit handling
Remove the if/else logic to exit from the in case a signal arrives.
Update comments.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:02:39 +0000 (17:02 +0100)]
xenpaging: move page add/resume loops into its own function.
Move page resume loop into its own function.
Move page eviction loop into its own function.
Allocate all possible slots in a paging file to allow growing and
shrinking of the number of paged-out pages. Adjust other places to
iterate over all slots.
This change is required by subsequent patches.
v2:
- check if victims allocation succeeded
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:02:38 +0000 (17:02 +0100)]
xenpaging: track the number of paged-out pages
This change is required by subsequent changes.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:02:36 +0000 (17:02 +0100)]
xenpaging: remove xc_dominfo_t from paging_t
Remove xc_dominfo_t from paging_t, record only max_pages.
This value is used to setup internal data structures.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:02:22 +0000 (17:02 +0100)]
xenpaging: update xenpaging_init
Move comment about xc_handle to the right place.
Allocate paging early and use calloc.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:01:41 +0000 (17:01 +0100)]
xenpaging: print gfn in failure case
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:01:39 +0000 (17:01 +0100)]
xenpaging: simplify file_op
Catch lseek() errors.
Use -1 as return value and let caller read errno.
Remove const casts from buffer pointers, the page is writeable.
Use wrapper for write() which matches the read() prototype.
Remove unused stdarg.h inclusion.
Remove unused macro.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:01:32 +0000 (17:01 +0100)]
xenpaging: use PERROR to print errno
v3:
- adjust arguments for xc_mem_paging_enable() failures
v2:
- move changes to file_op() to different patch
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:01:20 +0000 (17:01 +0100)]
xenpaging: remove obsolete comment in resume path
Remove stale comment.
If a page was populated several times the vcpu is paused and
xenpaging has to unpause it again.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Olaf Hering [Sun, 20 Nov 2011 16:01:15 +0000 (17:01 +0100)]
xenpaging: remove filename from comment
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Anil Madhavapeddy [Thu, 24 Nov 2011 19:09:55 +0000 (19:09 +0000)]
libvchan: fix segfault in client error path
In libvchan_client_init, go to the error path if the gntdev device is
not available. Otherwise, a segfault happens later as the vchan
context is invalid.
Signed-off-by: Anil Madhavapeddy <anil@recoil.org>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Thu, 24 Nov 2011 19:00:25 +0000 (19:00 +0000)]
tools/check: Add files missing from 24205:
5c88358164cc
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 24 Nov 2011 17:43:36 +0000 (17:43 +0000)]
tools: check for libaio unless user has configured CONFIG_SYSTEM_LIBAIO=n
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Andres Lagar-Cavilla [Thu, 24 Nov 2011 17:05:25 +0000 (17:05 +0000)]
x86/mm: Fix liveness of pages in grant copy operations
We were immediately putting the p2m entry translation for grant
copy operations. This allowed for an unnecessary race by which the
page could have been swapped out between the p2m lookup and the actual
use. Hold on to the p2m entries until the grant operation finishes.
Also fixes a small bug: for the source page of the copy, get_page
was assuming the page was owned by the source domain. It may be a
shared page, since we don't perform an unsharing p2m lookup.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
Andres Lagar-Cavilla [Thu, 24 Nov 2011 17:05:25 +0000 (17:05 +0000)]
x86/mm: Ensure liveness of pages involved in a guest page table walk
Instead of risking deadlock by holding onto the gfn's acquired during
a guest page table walk, acquire an extra reference within the get_gfn/
put_gfn critical section, and drop the extra reference when done with
the map. This ensures liveness of the map, i.e. the underlying page
won't be paged out.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
Ian Campbell [Thu, 24 Nov 2011 17:00:33 +0000 (17:00 +0000)]
libvchan: clean *.opic
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Jan Beulich [Thu, 24 Nov 2011 16:56:26 +0000 (17:56 +0100)]
x86: small fixes to pcpu platform op handling
XENPF_get_cpuinfo should init the flags output field rather than only
modify it.
XENPF_cpu_online must check for the input CPU number to be in range.
XENPF_cpu_offline must also do that, and should also reject attempts to
offline CPU 0 (this fails in cpu_down() too, but preventing this here
appears more correct given that the code here calls
continue_hypercall_on_cpu(0, ...), which would be flawed if cpu_down()
would ever allow bringing down CPU 0 (and a distinct error code is
easier to deal with when debugging issues).
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Andres Lagar-Cavilla [Thu, 24 Nov 2011 16:34:34 +0000 (16:34 +0000)]
x86/mm: ASSERT we are putting the right gfn in the XENMAPSPACE_gmfn* cases
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
Andres Lagar-Cavilla [Thu, 24 Nov 2011 16:34:34 +0000 (16:34 +0000)]
x86/mm: handle HVMOP_modified_memory on shared pages
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
Andres Lagar-Cavilla [Thu, 24 Nov 2011 16:34:34 +0000 (16:34 +0000)]
x86/mm: fix domain-paging's interaction with log-dirty
Allow pages typed log dirty to be paged out, and the proper type to
restored when paging pages back in.
Signed-off-by: Andres lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
Keir Fraser [Thu, 24 Nov 2011 15:50:08 +0000 (15:50 +0000)]
x86/waitqueue: Because we have per-cpu stacks, we must wake up on teh
same cpu that we slept on. Otherwise stack references are bogus on
wakeup.
Signed-off-by: Keir Fraser <keir@xen.org>
Keir Fraser [Thu, 24 Nov 2011 15:49:25 +0000 (15:49 +0000)]
waitqueue: Reorder prepare_to_wait() so that vcpu is definitely on the
queue on exit, even after a wakeup.
Otherwise, when we go round the loop in wait_event(), we may not
actually sleep after the first iteration, as we do not put ourselves
back on the queue on wakeup.
Signed-off-by: Keir Fraser <keir@xen.org>
Keir Fraser [Thu, 24 Nov 2011 15:48:10 +0000 (15:48 +0000)]
waitqueue: Detect saved-stack overflow and crash the guest.
Signed-off-by: Keir Fraser <keir@xen.org>
Andres Lagar-Cavilla [Thu, 24 Nov 2011 15:45:19 +0000 (15:45 +0000)]
Properly compare "pci" token when groking serial port config
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
Andres Lagar-Cavilla [Thu, 24 Nov 2011 15:44:51 +0000 (15:44 +0000)]
Trivial fix for rc val in hap track dirty vram
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
Jean Guyader [Thu, 24 Nov 2011 15:43:59 +0000 (15:43 +0000)]
hvmloader: Intel GPU passthrough, reverse OpRegion
The Intel GPU uses a two pages NVS region called OpRegion.
In order to get full support for the driver in the guest
we need to map this region.
This patch reserves 2 pages on the top of the memory in the
reserved area and mark this region as NVS in the e820. Then
we write the address to the config space (offset 0xfc) so the
device model can map the OpRegion at this address in the guest.
Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Andres Lagar-Cavilla [Thu, 24 Nov 2011 15:20:57 +0000 (15:20 +0000)]
x86/mm/p2m: don't overwrite m2p entry of still-shared pages
When updating a p2m mapping to shared, previous code
unconditionally set the m2p entry for the old mfn to invalid.
We now check that the old mfn does not remain shared.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
Andres Lagar-Cavilla [Thu, 24 Nov 2011 15:20:57 +0000 (15:20 +0000)]
x86/mm: change return code for log-dirty disabling
Disabling log dirty mode in HAP always returns -EINVAL. Make it
return the correct rc on success.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
Andres Lagar-Cavilla [Thu, 24 Nov 2011 15:20:57 +0000 (15:20 +0000)]
x86/mm/p2m: fix pod locking
The path p2m-lookup -> p2m-pt->get_entry -> 1GB PoD superpage ->
pod_demand_populate ends in the pod code performing a p2m_set_entry with
no locks held (in order to split the 1GB superpage into 512 2MB ones)
Further, it calls p2m_unlock after that, which will break the spinlock.
This patch attempts to fix that.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
Jan Beulich [Thu, 24 Nov 2011 08:44:54 +0000 (09:44 +0100)]
ia64: build fixes (again)
This undoes a single change from c/s 24136:
3622d7fae14d
(common/grant_table.c) and several from c/s 24100:
be8daf78856a
(common/memory.c). It also completes the former with two previously
missing ia64 specific code adjustments. Authors Cc-ed.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Paul Durrant [Wed, 23 Nov 2011 12:03:37 +0000 (12:03 +0000)]
libxl: Prevent xl save from segfaulting when control/shutdown key is removed
To acknowledge the tools' setting of control/shutdown it is normal for
PV drivers to rm the key. This leads to libxl__xs_read() returning
NULL and thus a subsequent strcmp on the return value will cause a
segfault.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Wed, 23 Nov 2011 11:15:31 +0000 (11:15 +0000)]
tools: use system libaio for blktap1 as well.
24184:
4ecd3615e726 missed this because I was accidentally testing with a
.config containing CONFIG_SYSTEM_LIBAIO=n. Tools tree now fully rebuilt
without this. There were no other issues.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 22 Nov 2011 18:51:13 +0000 (18:51 +0000)]
docs: remove some fatally out of date documentation
I think these are better off deleted than remaining to confuse people.
docs/misc/blkif-drivers-explained.txt:
- Talks about Xen 2.0 beta, talks about the old pre-xenstored IPC mechanism.
docs/misc/cpuid-config-for-guest.txt:
- Doesn't really say anything, in particular doesn't actually describe how to
configure CPUID.
docs/misc/hg-cheatsheet.txt:
- Not out of date per-se wrt mercural but talk about Xen 2.0 and gives URLs
under www.cl.cam.ac.uk. Talks a lot about bitkeeper. Given that mercurial is
hardly unusual anymore I think there must be better guides out there so this
one is not worth resurecting.
docs/misc/network_setup.txt:
- This is more comprehensively documented on the wiki these days.
docs/misc/VMX_changes.txt:
- Is basically a changelog from the initial implementation of VMX in 2004.
I'm not sure about some of the other docs, but these ones seemed fairly
obvious.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 22 Nov 2011 17:24:51 +0000 (17:24 +0000)]
tools: use system installed libaio by default.
I could have sworn I did this years ago.
IIRC the need for our own copy was due to the use of io_set_eventfd which is
not present in version 0.3.106. However it is in 0.3.107 the first version of
which was uploaded to Debian in June 2008 (I can't find a better reference for
the release date).
The necessary version is available in Debian Lenny onwards and is in at least
RHEL 6, Fedora 13 and OpenSuSE 11.3. The necessary version appears to not be
available in RHEL 5 or SLES 11 which is why I haven't simply nuked the in tree
version.
This is based on tools-system-libaio.diff from the Debian packaging although I
have made it optional (but default on).
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Tue, 22 Nov 2011 17:09:12 +0000 (17:09 +0000)]
Merge
Daniel De Graaf [Tue, 22 Nov 2011 17:07:32 +0000 (17:07 +0000)]
xenstore: xenbus cannot be opened read-only
In order to read keys from xenstore, the xenstore libraries need to
write the request to the xenbus socket. This means that the socket
cannot be opened read-only.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Jan Beulich [Tue, 22 Nov 2011 16:22:31 +0000 (17:22 +0100)]
move pci_find_ext_capability() into common PCI code
There's nothing architecture specific about it. It requires, however,
that x86-32's pci_conf_read32() tolerates register accesses above 255
(for consistency the adjustment is done to all pci_conf_readNN()
functions).
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Stefano Stabellini [Tue, 22 Nov 2011 16:19:48 +0000 (16:19 +0000)]
libxl: Add a vkbd frontend/backend pair for HVM guests
Linux PV on HVM guests can use vkbd, so add a vkbd frontend/backend
pair for HVM guests by default. It is useful because it doesn't
require frequent qemu wakeups as the usb keyboard/mouse does.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Tue, 22 Nov 2011 16:19:11 +0000 (16:19 +0000)]
Update QEMU_TAG
Keir Fraser [Tue, 22 Nov 2011 15:35:26 +0000 (15:35 +0000)]
debug: Add domain/vcpu pause_count info to 'd' key.
Signed-off-by: Keir Fraser <keir@xen.org>
Daniel De Graaf [Tue, 22 Nov 2011 13:29:48 +0000 (13:29 +0000)]
xsm/flask: fix resource list range checks
The FLASK security checks for resource ranges were not implemented
correctly - only the permissions on the endpoints of a range were
checked, instead of all items contained in the range. This would allow
certain resources (I/O ports, I/O memory) to be used by domains in
contravention to security policy.
This also corrects a bug where adding overlapping resource ranges did
not trigger an error.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
Daniel De Graaf [Tue, 22 Nov 2011 13:29:01 +0000 (13:29 +0000)]
xsm/flask: Use correct flag to detect writable grant mappings
The flags passed to xsm_grant_mapref are the flags from the map
operation (GNTMAP_*), not status flags (GTF_*).
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
Wei Wang [Tue, 22 Nov 2011 13:27:19 +0000 (13:27 +0000)]
amd iommu: Support INVALIDATE_IOMMU_ALL command.
It is one of the new architectural commands supported by iommu v2.
It instructs iommu to clear all address translation and interrupt
remapping caches for all devices and all domains.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
Wei Wang [Tue, 22 Nov 2011 13:26:46 +0000 (13:26 +0000)]
amd iommu: Factor out iommu command handling functions,
and move them into a new file.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
Wei Wang [Tue, 22 Nov 2011 13:26:11 +0000 (13:26 +0000)]
amd iommu: Fix incorrect definitions.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Keir Fraser <keir@xen.org>